package com.zhaoyuxi.redpack.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;



import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-04-02
 */
@Data
@Accessors(chain = true)
public class TbRedpack extends Model<TbRedpack> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 发红包用户
     */
    @TableField("userId")
    private String userId;

    /**
     * 红包金额
     */
    private BigDecimal amount;

    /**
     * 单个红包金额
     */
    @TableField("unitAmount")
    private BigDecimal unitAmount;

    /**
     * 红包个数
     */
    private Integer total;

    /**
     * 红包剩余个数
     */
    private Integer remain;

    /**
     * 发红包时间
     */
    @TableField("sendDate")
    private Date sendDate;

    /**
     * 版本控制，扩展乐观锁使用
     */
    private Integer version;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
